package cn.itcast.listener;

import com.alibaba.fastjson.JSON;
import cn.itcast.utils.commons.MailUtils;
//import org.springframework.amqp.core.Message;
//import org.springframework.amqp.core.MessageListener;

import javax.mail.MessagingException;
import java.util.Map;

public class MqListener  {
    //implements MessageListener
    /*@Override
    public void onMessage(Message message) {
        byte[] messageBody = message.getBody();
        Map<String,String> map = JSON.parseObject(messageBody, Map.class);
        String email = map.get("email");
        String emailMsg = map.get("emailMsg");
        try {
            MailUtils.sendMail(email,emailMsg);
            System.out.println("邮件发送成功！");
        } catch (MessagingException e) {
            e.printStackTrace();
            System.out.println("线路堵车了，请稍后再试。。。");
        }
    }*/
}
